<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['create.user']}">
	<h:panelGrid ><h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText></h:panelGrid>
	
	<t:panelGrid columns="2">
		<h:outputText></h:outputText>
		<h:panelGroup>
		  	<h:outputText value="*" styleClass="standardText_Mandatory" /> 
			<h:outputText value="#{messages['instruction']}" styleClass="standardText_Instruction" />
		</h:panelGroup>

		<h:outputText></h:outputText>
		<t:message for="Username" styleClass="error"></t:message>

		<t:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<t:outputText styleClass="standardText_Label" value="#{messages['username']}"></t:outputText>
		</t:panelGroup>
		<t:inputText id="Username" required="true" value="#{userMgmtBean.newUser.username}" styleClass="standardText"></t:inputText>
		
		<h:outputText></h:outputText>
		<t:message for="Password" styleClass="error"></t:message>

		
		<t:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<t:outputText styleClass="standardText_Label" value="#{messages['password']}"></t:outputText>
		</t:panelGroup>
		<t:inputSecret id="Password" required="true" value="#{userMgmtBean.newUser.password}"></t:inputSecret>
		
		<h:outputText></h:outputText>
		<t:message for="RetypePassword" styleClass="error"></t:message>
		
		<t:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<t:outputText styleClass="standardText_Label" value="#{messages['retype.password']}"></t:outputText>
		</t:panelGroup>
		<t:inputSecret id="RetypePassword" required="true" value="#{userMgmtBean.retypePassword}"></t:inputSecret>
		
		<h:outputText></h:outputText>
		<t:message for="Role" styleClass="error"></t:message>
		
		<t:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<t:outputText styleClass="standardText_Label" value="#{messages['role']}"></t:outputText>
		</t:panelGroup>
		
		<t:selectOneMenu id="Role" required="true" value="#{userMgmtBean.selectRoleId}" styleClass="standardText">
			<f:selectItem  itemLabel="#{messages['please.select']}" itemValue=""/>
			<f:selectItems value="#{userMgmtBean.rolesList}"/>
		</t:selectOneMenu>
		
		<f:verbatim><br></f:verbatim>
		<f:verbatim><br></f:verbatim>
		
		<f:verbatim><br></f:verbatim>
		<t:panelGroup>
		 <t:panelGrid columns="2" cellspacing="5">
			<h:commandButton value="#{messages['create']}" styleClass="button" action="#{userMgmtBean.createUserAction}"></h:commandButton>
			<h:commandButton value="#{messages['back']}" styleClass="button" immediate="true" action="listUser"></h:commandButton>
			</t:panelGrid>
		</t:panelGroup>
	</t:panelGrid>

</rich:panel>
